package cn.tedu.oop;

import jdk.nashorn.internal.objects.annotations.Setter;

public class TestDemo {
    public static void main(String[] args) {
        User2 u=new User2();
        u.setName("张三");
        u.setPrice(199.99);
        System.out.println(u.getName());
        System.out.println(u.getPrice());
    }
}
class User2{
    private String name;
    private double price;
    //先新建
    //空白行邮件-->Generate-->Getter and Setter-->Ctrl+A全选所有属性，回车

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
    public int id;
    public String job;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }
}
